package com.example.dddsample.domain.service;

import com.example.dddsample.domain.entity.KafkaAggregate;
import com.example.dddsample.domain.repository.KafkaTopicOperExt;

import javax.inject.Named;

/**
 * @author: bebm
 * @date: 2022/4/6 17:02
 * @description:
 */
@Named
public class KafkaService {

    private final KafkaTopicOperExt kafkaTopicOperExt;

    /**
     * KafkaService
     * @param kafkaTopicOperExt kafkaTopicOperExt
     */
    public KafkaService(KafkaTopicOperExt kafkaTopicOperExt){
        this.kafkaTopicOperExt=kafkaTopicOperExt;
    }

    /**
     * createTopic
     * @param kafkaAggregate
     */
    public void createTopic(KafkaAggregate kafkaAggregate){
        kafkaTopicOperExt.createTopic(kafkaAggregate);
    }

    /**
     * deleteTopic
     * @param kafkaAggregate
     */
    public void deleteTopic(KafkaAggregate kafkaAggregate){
        kafkaTopicOperExt.deleteTopic(kafkaAggregate);
    }

}
